Optimal. Leaf size=165 \[ \frac {(4 a A+3 b B+3 a C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {(5 A b+5 a B+4 b C) \tan (c+d x)}{5 d}+\frac {(4 a A+3 b B+3 a C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {(b B+a C) \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {b C \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {(5 A b+5 a B+4 b C) \tan ^3(c+d x)}{15 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 165, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {4161, 4132,
3852, 4131, 3853, 3855} \begin {gather*} \frac {\tan ^3(c+d x) (5 a B+5 A b+4 b C)}{15 d}+\frac {\tan (c+d x) (5 a B+5 A b+4 b C)}{5 d}+\frac {(4 a A+3 a C+3 b B) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {\tan (c+d x) \sec (c+d x) (4 a A+3 a C+3 b B)}{8 d}+\frac {(a C+b B) \tan (c+d x) \sec ^3(c+d x)}{4 d}+\frac {b C \tan (c+d x) \sec ^4(c+d x)}{5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3852
Rule 3853
Rule 3855
Rule 4131
Rule 4132
Rule 4161
Rubi steps
\begin {align*} \int \sec ^3(c+d x) (a+b \sec (c+d x)) \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {b C \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {1}{5} \int \sec ^3(c+d x) \left (5 a A+(5 A b+5 a B+4 b C) \sec (c+d x)+5 (b B+a C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b C \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {1}{5} \int \sec ^3(c+d x) \left (5 a A+5 (b B+a C) \sec ^2(c+d x)\right ) \, dx+\frac {1}{5} (5 A b+5 a B+4 b C) \int \sec ^4(c+d x) \, dx\\ &=\frac {(b B+a C) \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {b C \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {1}{4} (4 a A+3 b B+3 a C) \int \sec ^3(c+d x) \, dx-\frac {(5 A b+5 a B+4 b C) \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{5 d}\\ &=\frac {(5 A b+5 a B+4 b C) \tan (c+d x)}{5 d}+\frac {(4 a A+3 b B+3 a C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {(b B+a C) \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {b C \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {(5 A b+5 a B+4 b C) \tan ^3(c+d x)}{15 d}+\frac {1}{8} (4 a A+3 b B+3 a C) \int \sec (c+d x) \, dx\\ &=\frac {(4 a A+3 b B+3 a C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {(5 A b+5 a B+4 b C) \tan (c+d x)}{5 d}+\frac {(4 a A+3 b B+3 a C) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {(b B+a C) \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {b C \sec ^4(c+d x) \tan (c+d x)}{5 d}+\frac {(5 A b+5 a B+4 b C) \tan ^3(c+d x)}{15 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.26, size = 124, normalized size = 0.75 \begin {gather*} \frac {15 (4 a A+3 b B+3 a C) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (15 (4 a A+3 b B+3 a C) \sec (c+d x)+30 (b B+a C) \sec ^3(c+d x)+8 \left (15 (A b+a B+b C)+5 (A b+a B+2 b C) \tan ^2(c+d x)+3 b C \tan ^4(c+d x)\right )\right )}{120 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 210, normalized size = 1.27
method | result | size |
derivativedivides | \(\frac {-A b \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+b B \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-C b \left (-\frac {8}{15}-\frac {\left (\sec ^{4}\left (d x +c \right )\right )}{5}-\frac {4 \left (\sec ^{2}\left (d x +c \right )\right )}{15}\right ) \tan \left (d x +c \right )+a A \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-B a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+a C \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(210\) |
default | \(\frac {-A b \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+b B \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-C b \left (-\frac {8}{15}-\frac {\left (\sec ^{4}\left (d x +c \right )\right )}{5}-\frac {4 \left (\sec ^{2}\left (d x +c \right )\right )}{15}\right ) \tan \left (d x +c \right )+a A \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-B a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+a C \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(210\) |
norman | \(\frac {-\frac {4 \left (25 A b +25 B a +29 C b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}+\frac {\left (4 a A -8 A b -8 B a +5 b B +5 a C -8 C b \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {\left (4 a A +8 A b +8 B a +5 b B +5 a C +8 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (12 a A -32 A b -32 B a +3 b B +3 a C -16 C b \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {\left (12 a A +32 A b +32 B a +3 b B +3 a C +16 C b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{5}}-\frac {\left (4 a A +3 b B +3 a C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {\left (4 a A +3 b B +3 a C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) | \(270\) |
risch | \(-\frac {i \left (60 a A \,{\mathrm e}^{9 i \left (d x +c \right )}+45 B b \,{\mathrm e}^{9 i \left (d x +c \right )}+45 C a \,{\mathrm e}^{9 i \left (d x +c \right )}+120 A a \,{\mathrm e}^{7 i \left (d x +c \right )}+210 B b \,{\mathrm e}^{7 i \left (d x +c \right )}+210 C a \,{\mathrm e}^{7 i \left (d x +c \right )}-240 A b \,{\mathrm e}^{6 i \left (d x +c \right )}-240 B a \,{\mathrm e}^{6 i \left (d x +c \right )}-560 A b \,{\mathrm e}^{4 i \left (d x +c \right )}-560 B a \,{\mathrm e}^{4 i \left (d x +c \right )}-640 C b \,{\mathrm e}^{4 i \left (d x +c \right )}-120 a A \,{\mathrm e}^{3 i \left (d x +c \right )}-210 B b \,{\mathrm e}^{3 i \left (d x +c \right )}-210 C a \,{\mathrm e}^{3 i \left (d x +c \right )}-400 A b \,{\mathrm e}^{2 i \left (d x +c \right )}-400 B a \,{\mathrm e}^{2 i \left (d x +c \right )}-320 C b \,{\mathrm e}^{2 i \left (d x +c \right )}-60 A a \,{\mathrm e}^{i \left (d x +c \right )}-45 B b \,{\mathrm e}^{i \left (d x +c \right )}-45 C a \,{\mathrm e}^{i \left (d x +c \right )}-80 A b -80 B a -64 C b \right )}{60 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{5}}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{2 d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b B}{8 d}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{8 d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{2 d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b B}{8 d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{8 d}\) | \(414\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 266, normalized size = 1.61 \begin {gather*} \frac {80 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a + 80 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A b + 16 \, {\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} C b - 15 \, C a {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 15 \, B b {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 60 \, A a {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{240 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.17, size = 182, normalized size = 1.10 \begin {gather*} \frac {15 \, {\left ({\left (4 \, A + 3 \, C\right )} a + 3 \, B b\right )} \cos \left (d x + c\right )^{5} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left ({\left (4 \, A + 3 \, C\right )} a + 3 \, B b\right )} \cos \left (d x + c\right )^{5} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (16 \, {\left (5 \, B a + {\left (5 \, A + 4 \, C\right )} b\right )} \cos \left (d x + c\right )^{4} + 15 \, {\left ({\left (4 \, A + 3 \, C\right )} a + 3 \, B b\right )} \cos \left (d x + c\right )^{3} + 8 \, {\left (5 \, B a + {\left (5 \, A + 4 \, C\right )} b\right )} \cos \left (d x + c\right )^{2} + 24 \, C b + 30 \, {\left (C a + B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, d \cos \left (d x + c\right )^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right ) \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \sec ^{3}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 473 vs.
\(2 (153) = 306\).
time = 0.52, size = 473, normalized size = 2.87 \begin {gather*} \frac {15 \, {\left (4 \, A a + 3 \, C a + 3 \, B b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (4 \, A a + 3 \, C a + 3 \, B b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (60 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 120 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 75 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 120 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 75 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 120 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 120 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 320 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 30 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 320 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 30 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 160 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 400 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 400 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 464 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 120 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 320 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 30 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 320 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 30 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 160 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 60 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 120 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 75 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 120 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 75 \, B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 120 \, C b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{5}}}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.67, size = 301, normalized size = 1.82 \begin {gather*} \frac {\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {A\,a}{2}+\frac {3\,B\,b}{8}+\frac {3\,C\,a}{8}\right )}{2\,A\,a+\frac {3\,B\,b}{2}+\frac {3\,C\,a}{2}}\right )\,\left (A\,a+\frac {3\,B\,b}{4}+\frac {3\,C\,a}{4}\right )}{d}-\frac {\left (2\,A\,b-A\,a+2\,B\,a-\frac {5\,B\,b}{4}-\frac {5\,C\,a}{4}+2\,C\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (2\,A\,a-\frac {16\,A\,b}{3}-\frac {16\,B\,a}{3}+\frac {B\,b}{2}+\frac {C\,a}{2}-\frac {8\,C\,b}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {20\,A\,b}{3}+\frac {20\,B\,a}{3}+\frac {116\,C\,b}{15}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-2\,A\,a-\frac {16\,A\,b}{3}-\frac {16\,B\,a}{3}-\frac {B\,b}{2}-\frac {C\,a}{2}-\frac {8\,C\,b}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (A\,a+2\,A\,b+2\,B\,a+\frac {5\,B\,b}{4}+\frac {5\,C\,a}{4}+2\,C\,b\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________